{extend name="public/base" /}
{block name="style"}
<style>
    .layui-table-cell {
        height: auto;
        line-height: 24px;
        white-space: normal;
        padding: 10px 15px;
    }
</style>
{/block}
{block name="content"}
<form class="layui-form layui-form-pane form-search" action="{:url()}" onsubmit="return false" method="post" autocomplete="off">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">会员id</label>
        <label class="layui-input-inline">
            <input name="member_id" value="" type="text" placeholder="请输入会员id" class="layui-input">
        </label>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">邮箱</label>
        <label class="layui-input-inline">
            <input name="email" value="" type="text" placeholder="请输入邮箱"  class="layui-input">
        </label>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">所属币种</label>
        <div class="layui-input-inline">
            <select name="coin_id" lay-search class="layui-select">
                <option value='0'>全部</option>
                {foreach name="coinsList" item="vo"}
                    <option value='{$vo.id}'>{$vo.coin_name}</option>
               {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i>搜索</button>
    </div>
</form>
<table id="MemberCoinTable"  data-url="{:url('index')}" data-target-search="form.form-search"></table>
{/block}
{block name='script'}
<script>
    $(function () {
        $.menu.highlight_subnav("{:url('member-coin/index')}")
        $('#MemberCoinTable').layTable({
            even: true,
            height: 'full',
            method: 'post',
            sort: {field: 'id', type: 'desc'},
            url: "{:url('index')}" ,
            page: true,
            cols: [[
                {field: 'email', title: '会员资料',width:220, align: 'left',templet:function (d) {
                        str ='<a href="">id：'+d.id+"</a><br/>";
                        str += '<span>邀请码：'+d.invite_code+'</span><br/>';
                        str +='<span "data-copy">账号：'+d.email+'</span><br/>';
                        str +='<span>注册时间：'+d.register_at+'</span>'
                        return str;
                    }},

                {field: 'login_time', title: '登录IP/时间/地址', align: 'left',width:250,templet:function (d){
                        str = '<span>ip：'+d.login_ip+'</span><br/>';
                        str +='<span>登录时间：'+d.login_at+'</span><br/>'
                        str +='<span>登录地址：'+d.login_address+'</span>';
                        return str;
                    }},
                {toolbar: '#toolbar', title: '操作面板', align: 'center', minWidth: 350, fixed: 'right'}
            ]]
        });
    });
</script>

<script type="text/html" id="toolbar">
    <a class="layui-btn layui-btn-sm"  data-title="编辑用户" data-modal='{:url("edit")}?id={{d.id}}'>编辑</a>
    <a class="layui-btn layui-btn-sm layui-btn-normal" data-title="审核认证" data-modal='{:url("audit")}?id={{d.id}}'>审核认证</a>
    <a class="layui-btn layui-btn-sm layui-btn-warm" data-title="充值" data-modal='{:url("pay")}?id={{d.id}}'>充值</a>
    <a class="layui-btn layui-btn-sm layui-btn-primary"     data-modal='{:url("letter/add")}?id={{d.id}}'>发送通知</a>
    <a class="layui-btn layui-btn-sm layui-btn-danger"     {{-d.pid!=0 ? 'style="display:none;"' : ''}}   onClick="setAgent('{{d.id}}')">设置代理</a>
</script>
{/block}
